home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / DONALDXC / FILECLOS.C < prev    next >
Text File  |  1990-05-01  |  971b  |  44 lines

  1. /********************************/
  2. /* File: FileClose.c            */
  3. /*                                */
  4. /* XCMD to access the file mgr    */
  5. /* call FSClose                    */
  6. /* Paramters:                    */
  7. /* param0 = file reference from    */
  8. /* the fileopen xcmd            */
  9. /* ----------------------------    */
  10. /********************************/
  11.  
  12. #include    <MacTypes.h>
  13. #include    <OSUtil.h>
  14. #include    <MemoryMgr.h>
  15. #include    <FileMgr.h>
  16. #include    <ResourceMgr.h>
  17. #include    <pascal.h>
  18. #include    <string.h>
  19. #include     "HyperXCmd.h"
  20. #include    "HyperUtils.h"
  21.  
  22.     
  23. pascal void main( paramPtr )
  24.     XCmdBlockPtr    paramPtr;
  25. {
  26.     short        refnum;
  27.     char        str[256];
  28.     
  29.     /* convert the refnum to a usable form */
  30.     HLock( paramPtr->params[0] );
  31.     ZeroToPas( paramPtr, *(paramPtr->params[0]), &str );
  32.     HUnlock( paramPtr->params[0] );
  33.     refnum = (short)StrToNum( paramPtr, &str );
  34.     
  35.     /* Normally we should check the result     */
  36.     /* code but it won't kill us to ignore    */
  37.     /* the reslt of a close file call        */
  38.     if ( FSClose(refnum) )
  39.         ;
  40.  
  41.     paramPtr->returnValue = 0L;
  42. }
  43.  
  44.